package com.uqbar.game.stateSpacecraft;

import java.util.List;

import com.uqbar.game.Bullet;
import com.uqbar.game.Spacecraft;
import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.appearances.Sprite;

public class StateInvisibility extends StateSpacecraft {

	private double t1 = 0;
	private double t2 = 0;
	private Sprite spriteSpacecraftInvisible;
	
	public StateInvisibility(Spacecraft spacecraft) {
		super(spacecraft);
		this.spacecraft.setSpeed(0);
		this.spacecraft.center();
		this.spriteSpacecraftInvisible = Sprite.fromImage("/spacecraft/nave_semi_transparente.png");
		this.spacecraft.setAppearance(spriteSpacecraftInvisible);
	}

	public void moveSpacecraft(DeltaState deltaState) {
		this.move(deltaState);
		this.rotateSpacraft(deltaState);
		this.spacecraft.align(this.spacecraft.getDiameter());
		
		if(t1+200 == t2){
			this.spacecraft.setState(new StatePlay(spacecraft));
		}
		t2++;
	}
	
	public Sprite getImage() {
		return this.spriteSpacecraftInvisible;
	}

	public List<Bullet> getBullets() {
		return null;
	}
	
}
